import request from 'umi-request';
import getFakeChartData from './mock-data';
import { getAccessToken } from '@/utils/authority';

export async function fakeChartData() {
  return getFakeChartData;
  // return request('/api/fake_chart_data');
}

export async function getMulti(data: any) {
  return request(`/AllLinks/dashboard/_multi?:X_Access_Token=${getAccessToken()}`, {
    method: 'POST',
    data,
  });
}

export async function searchCardLeft() {
  return request(`/AllLinks/dashboard/proto/info?:X_Access_Token=${getAccessToken()}`, {
    method: 'GET',
  });
}

export async function searchCardRight() {
  return request(`/AllLinks/dashboard/device/info?:X_Access_Token=${getAccessToken()}`, {
    method: 'GET',
  });
}

export async function searchProportion() {
  return request(`/AllLinks/dashboard/device_detail/info?:X_Access_Token=${getAccessToken()}`, {
    method: 'GET',
  });
}

export async function getTabledata() {
  return request(`/AllLinks/device/alarm/history/_query/tenantTopDevice?:X_Access_Token=${getAccessToken()}`, {
    method: 'GET',
  });
}
